<?php
session_start();

include 'dbconnect.php';

  // Check connection
if (mysqli_connect_errno())
  {
  //echo "alert'Failed to connect to MySQL: ' . mysqli_connect_error()";
  }
$number = $_SESSION['number'];
if ($number[0] == "+")
	$number[0] = "_";

$table = "SELECT * FROM contacts".$number;
$result = mysqli_query($con, $table);

$sql="UPDATE `contacts$number` SET `view` = '0';";

     if (!mysqli_query($con,$sql))
     {
          echo('Error: ' . mysqli_error($con));
     } 
  
mysqli_close($con);
?>
